<?php 
if(verify_page()){

if(isset($_GET['p'])){
	$page = '?p='.$_GET['p'];
?>
<div id="page_menu" class="menu">
	<ul>
    <?php
	if($_SESSION[sess_login]['permission'] == 2 || $_SESSION[sess_login]['permission'] == 3){
	?>
        <li id="list"><a href="<?=$page ?>&m=list">List User</a></li>
        <li id="new"><a href="<?=$page ?>&m=new">New User</a></li>
    <?php
	}
	?>
        <li id="userinfo"><a href="<?=$page ?>&m=userinfo">User Information</a></li>
        <li id="usergroup"><a href="<?=$page ?>&m=usergroup">Friend Group</a></li>
    </ul>
</div>

<div class="content_final">

<?php
	if(isset($_GET['m'])){
		$module = $_GET['m'];
	}
	else{
		$module = 'userinfo';
	}
?>
<script> $('#<?=$module ?> a').addClass('menu_active');</script>
<?php		
		switch ($module){
			case "login": 	{	
				$getpage = "user_login.php";
				break;
			}
			case "list": 	{	
				$getpage = "user_list.php";
				break;
			}
			case "new":	{
				$getpage = "user_new.php";
				break;
			}
			case "userinfo": 	{	
				$getpage = "user_info.php";
				break;
			}
			case "usergroup": 	{	
				$getpage = "user_group.php";
				break;
			}
			default:		{
				$getpage = "user_info.php";
				break;
			}
		}
					
		$getpage = "./module/user/".$getpage;
		
		if(file_exists($getpage)){
			include $getpage; 
		}
		else {
			echo '<center><br /><br />Trang đang truy cập không tồn tại hoặc đang xây dựng!<br /><br /><br /></center>';
		}
}
?>
</div>
<script language="javascript" type="text/javascript" src="./script/script-user.js"></script>
<?php
}
else{
		if(file_exists('./module/user/user_login.php')){
			include './module/user/user_login.php'; 
		}
		else {
			echo '<center><br /><br />You are not permission<br /></center>';
		}
}
?>

